<!DOCTYPE html>
<html lang="en">

</html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>综合管理平台</title>
  <link href="css/style.css" rel="stylesheet" type="text/css" />
</head>

<body class="Login">
  <!--Login-开始-->

  <div class="Login_heand dk">
    <a href="#" class="Login_logo fl">
      <img src="images/logo.png" class="fl" />
      <p class="fl">综合管理平台</p>
      <div class="clear"></div>
    </a>
  </div>

  <div class="Login_k">
    <div class="Login_T">
      用户注册
      <p></p>
    </div>
    <!--登录-开始-->
    <form class="Login_dl">
      <div class="Login_row">
        <input name="zhanghao" type="text" value="" class="Login_input Login_inp1" id="userName" placeholder="用户名" onblur="checkUser()"/>
        <div id="user_prompt">用户名由8-16位字母、数字、下划线组成，必须字母开头</div>
      </div>
      <div class="Login_row">
        <input name="password" type="password" value="" class="Login_input Login_inp2" id="pwd" placeholder="密码" />
      </div>
      <div class="Login_row">
        <input name="password" type="password" value="" class="Login_input Login_inp2" id="repwd" placeholder="确认密码" />
      </div>
      <div class="Login_row">
        <input name="email" type="email" value="" class="Login_input Login_inp3" id="email" placeholder="邮箱地址" />
      </div>
      <a href="#" class="Login_dla">注册</a>

      <label class="Login_pitch fl">
        <input type="checkbox" name="checkbox01" class="fl" />
        <div class="fl">自动登录</div>
        <div class="clear"></div>
      </label>
      <div class="Login_wj fr">
        <a href="login.html">返回登录</a>
      </div>
      <div class="clear"></div>
    </form>
    <!--登录-结束-->
  </div>
  <!--Login-结束-->

  <script>
    //验证用户名
    function checkUser(){
      //正则表达式
      var reg = /^[a-zA-Z]\w{7,15}/;
      //获取用户输入的文本
      var user = document.getElementById('userName').value;
      //获取提示信息对象
      var user_prompt = document.getElementById('user_prompt');
      //符合要求
      if( reg.test(user)){
        user_prompt.innerHTML = '';
        return true;
      }else{
        user_prompt.innerHTML = '用户名格式有误'
        return false;
      }
    }
  </script>
</body>

</html>